include('box2d');

// Shortcuts to ease usage and reading.
var
  b2Vec2 = Box2D.Common.Math.b2Vec2,
  b2AABB = Box2D.Collision.b2AABB,
  b2BodyDef = Box2D.Dynamics.b2BodyDef,
  b2Body = Box2D.Dynamics.b2Body,
  b2FixtureDef = Box2D.Dynamics.b2FixtureDef,
  b2Fixture = Box2D.Dynamics.b2Fixture,
  b2World = Box2D.Dynamics.b2World,
  b2MassData = Box2D.Collision.Shapes.b2MassData,
  b2PolygonShape = Box2D.Collision.Shapes.b2PolygonShape,
  b2CircleShape = Box2D.Collision.Shapes.b2CircleShape,
  b2DebugDraw = Box2D.Dynamics.b2DebugDraw,
  b2MouseJointDef = Box2D.Dynamics.Joints.b2MouseJointDef;


new_class(
  'physics.shapes.Circle',
  function(x,y,radius) { this.x = x; this.y = y; this.radius = radius; },
  {
    __createShape: function() {
      return new b2CircleShape(this.radius);
    }
  });

new_class(
  'physics.shapes.Square',
  function(x,y,size) { this.x = x; this.y = y; this.size = size; },
  {
    __createShape: function() {
      var ret = new b2PolygonShape();
      ret.SetAsBox(this.size, this.size);
      return ret;
    }
  })
